package com.alpesressources.comexpert.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import org.apache.commons.codec.binary.Hex;

public class Md5Hash {
	public static String getHash(String str) {
		String ret=null;
		
		try {
			MessageDigest msgDigest=MessageDigest.getInstance("MD5");
			
			msgDigest.update(str.getBytes());
			byte[] digest=msgDigest.digest();
			
			ret=new String(Hex.encodeHex(digest));
			
		} catch (NoSuchAlgorithmException e) {
			
		}
		
		return ret;
	}
}
